package com.example.bestudentsystem.demos.web.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.bestudentsystem.demos.web.pojo.SC;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.sql.Timestamp;

@Mapper
public interface SCMapper extends BaseMapper<SC> {
    @Select("SELECT attendance FROM sc WHERE sno=#{sno} AND cno=#{cno}")
    float getAttendance(String sno,String cno);
    @Update("UPDATE sc SET score=#{score} WHERE sno=#{sno} AND cno=#{cno}")
    void updateScore(int score,String sno,String cno);

    @Update("UPDATE sc SET attendance=#{attendance} WHERE sno=#{sno} AND cno=#{cno}")
    void updateAttendance(float attendance, String sno, String cno);
    @Insert("INSERT INTO sc(sno,cno) VALUES(#{sno},#{cno}) ")
    void addSC(String sno, String cno);
}
